1. Field of the Present Invention
The present invention generally relates to the field of computer software and more particularly to a system and method for testing interactions between test cases executing on a data processing system or network.
2. History of Related Art
In the field of computers and, more particularly, computer networks, it is often desirable to characterize or debug the network by executing a specific sequence of events on the network to determine if the particular sequence produces any unanticipated actions or results. In a TCP/IP connected network, for example, multiple nodes of a network are interconnected and capable of communicating with one another. In such a network, a communication link or pipeline between any two nodes can be established by opening a xe2x80x9csocket,xe2x80x9d which consists of an Internet protocol (IP) address and a port number for each node. When the socket is open, the nodes at either end of the pipeline transmit packets to communicate information (data) back and forth. When the data transmission is completed, the socket is closed. The TCP/IP protocol is just one example of a mechanism by which nodes on a network can communicate with one another.
Because a network typically may include a large number of computers or other data processing devices or systems running on a variety of platforms, the number of events or sequences of events that the network may experience is virtually limitless and essentially impossible to predict or otherwise anticipate. Thus, the task of debugging or characterizing a network for reliable interaction between the nodes in a timely manner is exceedingly difficult. Typically, the task of characterizing a network consists of a user writing a series of test sequences, each of which includes one or more test cases that are assembled in a manner determined by the user. The user must write a new test sequence for each specific sequence of events that the user wants to execute. In this manner, the typical method of generating test sequences is manually intensive thereby making it essentially impossible to produce enough test sequences to achieve any significant degree of coverage for a network of any appreciable complexity. The ""629 application disclosed a system and method enabling a user to automatically generate large numbers of test sequences to exercise a computer network or other similar system including facilities to exercise two or more test cases in parallel.
While providing a mechanism for enabling parallel execution of multiple test cases is highly desirable, it would be still further desirable to enable a mechanism to stress interactions between test cases that execute in parallel by randomly varying the starting times of test cases within a parallel test segment.
The goal identified above is achieved by a method and system disclosed herein for executing test cases within a parallel test segment of a test sequence to stress interactions between the test cases. Initially, a test sequence is defined that includes a parallel test segment including at least a first test case and a second test case. The cycle time of the parallel test segment is determined. During each iteration, the initiation or start time of the first and second test cases is varied with respect to one another. In one embodiment, the determined cycle time is greater than the execution time of either the first or second test cases. The cycle time may be calculated by measuring the execution time of the first test and second test cases, determining a desired slack time for the first test case if the first test case is longer than the second test case, calculating a test segment cycle time based on the measured cycle times and the desired slack time, and calculating a slack time for the second test case based on the test segment cycle time and the measured execution time of the second test case. In one embodiment, the start times of the first and second test cases are generated randomly within their respective slack times. In one embodiment, the test sequence is executed repeatedly until terminated by a user. In another embodiment, the test sequence executes a specified number of iterations. The number of iterations that the test sequence executes may be specified directly by the user. Alternatively, the user may specify a total test time from which the number of test sequence iterations is derived by dividing the total test time by the test sequence cycle time.